package com.itheima.day04;
/*
案例3: 比较数组元素的大小:
 */

public class TestClassCase03 {

    public static void main(String[] args) {


        double[] num = {12.9, 53.54, 75.0, 99.1, 3.14};
        double min = num[0];
        double max = num[0];

        for (int i = 1; i < num.length; i++) {
            if (num[i] < min) {
                min = num[i];
            }
        }
        System.out.println("最小数是:" + min);

        for (int i = 1; i < num.length; i++) {
            if (num[i] > max) {
                max = num[i];
            }
        }
        System.out.println("最大数是:" + max);


    }
}
